<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>JSDoc: Class: AsyncStream</title>

    <script src="scripts/prettify/prettify.js"> </script>
    <script src="scripts/prettify/lang-css.js"> </script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>

<body>

<div id="main">

    <h1 class="page-title">Class: AsyncStream</h1>

    




<section>

<header>
    
        <h2>AsyncStream</h2>
        
    
</header>

<article>
    <div class="container-overview">
    
        

    

    <h4 class="name" id="AsyncStream"><span class="type-signature"></span>new AsyncStream<span class="signature">()</span><span class="type-signature"></span></h4>

    



<div class="description">
    A wrapper around the Stream class to use setTiemout
and run stream "jobs" Asynchronously
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="decrypter_async-stream.js.html">decrypter/async-stream.js</a>, <a href="decrypter_async-stream.js.html#line6">line 6</a>
    </li></ul></dd>
    

    

    

    
</dl>
















    
    </div>

    
        <h3 class="subsection-title">Extends</h3>

        


    <ul>
        <li><a href="Stream.html">Stream</a></li>
    </ul>


    

    

    

     

    

    

    
        <h3 class="subsection-title">Methods</h3>

        
            

    

    <h4 class="name" id="dispose"><span class="type-signature"></span>dispose<span class="signature">()</span><span class="type-signature"></span></h4>

    



<div class="description">
    Destroys the stream and cleans up.
</div>













<dl class="details">

    

    

    
    <dt class="inherited-from">Inherited From:</dt>
    <dd class="inherited-from"><ul class="dummy"><li>
        <a href="Stream.html#dispose">Stream#dispose</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="stream.js.html">stream.js</a>, <a href="stream.js.html#line84">line 84</a>
    </li></ul></dd>
    

    

    

    
</dl>
















        
            

    

    <h4 class="name" id="off"><span class="type-signature"></span>off<span class="signature">(type, listener)</span><span class="type-signature"> &rarr; {Boolean}</span></h4>

    



<div class="description">
    Remove a listener for a specified event type.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>type</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            

            

            <td class="description last">the event name</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>listener</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last">a function previously registered for this
type of event through `on`</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    
    <dt class="inherited-from">Inherited From:</dt>
    <dd class="inherited-from"><ul class="dummy"><li>
        <a href="Stream.html#off">Stream#off</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="stream.js.html">stream.js</a>, <a href="stream.js.html#line36">line 36</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    if we could turn it off or not
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Boolean</span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="on"><span class="type-signature"></span>on<span class="signature">(type, listener)</span><span class="type-signature"></span></h4>

    



<div class="description">
    Add a listener for a specified event type.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>type</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            

            

            <td class="description last">the event name</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>listener</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last">the callback to be invoked when an event of
the specified type occurs</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    
    <dt class="inherited-from">Inherited From:</dt>
    <dd class="inherited-from"><ul class="dummy"><li>
        <a href="Stream.html#on">Stream#on</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="stream.js.html">stream.js</a>, <a href="stream.js.html#line21">line 21</a>
    </li></ul></dd>
    

    

    

    
</dl>
















        
            

    

    <h4 class="name" id="pipe"><span class="type-signature"></span>pipe<span class="signature">(destination)</span><span class="type-signature"></span></h4>

    



<div class="description">
    Forwards all `data` events on this stream to the destination stream. The
destination stream should provide a method `push` to receive the data
events as they arrive.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>destination</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Stream.html">Stream</a></span>


            
            </td>

            

            

            <td class="description last">the stream that will receive all `data` events</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    
    <dt class="inherited-from">Inherited From:</dt>
    <dd class="inherited-from"><ul class="dummy"><li>
        <a href="Stream.html#pipe">Stream#pipe</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="stream.js.html">stream.js</a>, <a href="stream.js.html#line95">line 95</a>
    </li></ul></dd>
    

    

    
    <dt class="tag-see">See:</dt>
    <dd class="tag-see">
        <ul>
            <li><a href="http://nodejs.org/api/stream.html#stream_readable_pipe_destination_options">http://nodejs.org/api/stream.html#stream_readable_pipe_destination_options</a></li>
        </ul>
    </dd>
    

    
</dl>
















        
            

    

    <h4 class="name" id="push"><span class="type-signature"></span>push<span class="signature">(job)</span><span class="type-signature"></span></h4>

    



<div class="description">
    push a job into the stream
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>job</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last">the job to push into the stream</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="decrypter_async-stream.js.html">decrypter/async-stream.js</a>, <a href="decrypter_async-stream.js.html#line41">line 41</a>
    </li></ul></dd>
    

    

    

    
</dl>
















        
            

    

    <h4 class="name" id="trigger"><span class="type-signature"></span>trigger<span class="signature">(type)</span><span class="type-signature"></span></h4>

    



<div class="description">
    Trigger an event of the specified type on this stream. Any additional
arguments to this function are passed as parameters to event listeners.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>type</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            

            

            <td class="description last">the event name</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    
    <dt class="inherited-from">Inherited From:</dt>
    <dd class="inherited-from"><ul class="dummy"><li>
        <a href="Stream.html#trigger">Stream#trigger</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="stream.js.html">stream.js</a>, <a href="stream.js.html#line53">line 53</a>
    </li></ul></dd>
    

    

    

    
</dl>
















        
    

    

    
</article>

</section>




</div>

<nav>
    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="AES.html">AES</a></li><li><a href="AsyncStream.html">AsyncStream</a></li><li><a href="Decrypter.html">Decrypter</a></li><li><a href="HlsAudioTrack.html">HlsAudioTrack</a></li><li><a href="HlsHandler.html">HlsHandler</a></li><li><a href="MasterPlaylistController.html">MasterPlaylistController</a></li><li><a href="PlaylistLoader.html">PlaylistLoader</a></li><li><a href="Representation.html">Representation</a></li><li><a href="SegmentLoader.html">SegmentLoader</a></li><li><a href="SourceUpdater.html">SourceUpdater</a></li><li><a href="Stream.html">Stream</a></li></ul><h3>Global</h3><ul><li><a href="global.html#backwardDuration">backwardDuration</a></li><li><a href="global.html#bufferIntersection">bufferIntersection</a></li><li><a href="global.html#byterangeStr">byterangeStr</a></li><li><a href="global.html#calculateBufferedPercent">calculateBufferedPercent</a></li><li><a href="global.html#clamp">clamp</a></li><li><a href="global.html#decrypt">decrypt</a></li><li><a href="global.html#detectEndOfStream">detectEndOfStream</a></li><li><a href="global.html#duration">duration</a></li><li><a href="global.html#enableFunction">enableFunction</a></li><li><a href="global.html#findNextRange">findNextRange</a></li><li><a href="global.html#findRange">findRange</a></li><li><a href="global.html#findSoleUncommonTimeRangesEnd">findSoleUncommonTimeRangesEnd</a></li><li><a href="global.html#formatHexString">formatHexString</a></li><li><a href="global.html#forwardDuration">forwardDuration</a></li><li><a href="global.html#getMediaIndexForTime_">getMediaIndexForTime_</a></li><li><a href="global.html#getSegmentBufferedPercent">getSegmentBufferedPercent</a></li><li><a href="global.html#HlsSourceHandler">HlsSourceHandler</a></li><li><a href="global.html#intervalDuration">intervalDuration</a></li><li><a href="global.html#ntoh">ntoh</a></li><li><a href="global.html#objectChanged">objectChanged</a></li><li><a href="global.html#renditionSelectionMixin">renditionSelectionMixin</a></li><li><a href="global.html#resolveUrl">resolveUrl</a></li><li><a href="global.html#safeGetComputedStyle">safeGetComputedStyle</a></li><li><a href="global.html#seekable">seekable</a></li><li><a href="global.html#segmentXhrHeaders">segmentXhrHeaders</a></li><li><a href="global.html#textRange">textRange</a></li><li><a href="global.html#updateMaster">updateMaster</a></li><li><a href="global.html#updateSegmentMetadata">updateSegmentMetadata</a></li><li><a href="global.html#updateSegments">updateSegments</a></li><li><a href="global.html#utils">utils</a></li></ul>
</nav>

<br class="clear">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on Thu Aug 04 2016 14:36:16 GMT-0400 (EDT)
</footer>

<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>